/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.com.aptech.msh.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author trietto
 */
@Entity
@Table(name = "faqgroup")
@NamedQueries({
    @NamedQuery(name = "FaqGroup.findAll", query = "SELECT f FROM FaqGroup f")})
public class FaqGroup implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "FaqGroupID")
    private Integer faqGroupID;
    @Basic(optional = false)
    @Column(name = "GroupName")
    private String groupName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "faqGroup", fetch = FetchType.EAGER)
    private List<Faq> faqList;

    public FaqGroup() {
    }

    public FaqGroup(Integer faqGroupID) {
        this.faqGroupID = faqGroupID;
    }

    public FaqGroup(Integer faqGroupID, String groupName) {
        this.faqGroupID = faqGroupID;
        this.groupName = groupName;
    }

    public Integer getFaqGroupID() {
        return faqGroupID;
    }

    public void setFaqGroupID(Integer faqGroupID) {
        this.faqGroupID = faqGroupID;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public List<Faq> getFaqList() {
        return faqList;
    }

    public void setFaqList(List<Faq> faqList) {
        this.faqList = faqList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (faqGroupID != null ? faqGroupID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FaqGroup)) {
            return false;
        }
        FaqGroup other = (FaqGroup) object;
        if ((this.faqGroupID == null && other.faqGroupID != null) || (this.faqGroupID != null && !this.faqGroupID.equals(other.faqGroupID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vn.com.aptech.msh.entities.FaqGroup[faqGroupID=" + faqGroupID + "]";
    }

}
